﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Media;
using System.IO;

public class PublicClass1
    {
    static private string UserNameLogin;
    public void PlaySoundTextBoxError()
    {
        SoundPlayer _P = new SoundPlayer(plvs.Properties.Resources.Alarm);
        _P.Play();
    }
    public void PlaySoundFromLoad()
    {
        SoundPlayer _P = new SoundPlayer(plvs.Properties.Resources.FromLoad);
        _P.Play();
    }
    public void PlaySoundAlarm()
    {
        SoundPlayer _P = new SoundPlayer(plvs.Properties.Resources.Alert);
        _P.Play();
    }
    public void CheckInternetConcetion()
    {
        try {
            if (!plvs.Properties.Settings.Default.InternetConection)
            {
                System.Net.IPHostEntry i = System.Net.Dns.GetHostEntry("www.google.com");
                plvs.Properties.Settings.Default.InternetConection = true;
                plvs.Properties.Settings.Default.Save();
            }
        }
        catch {
            plvs.Properties.Settings.Default.InternetConection = false;
            plvs.Properties.Settings.Default.Save();
        }
    }
    public string GetUserNameOfLoginProgram()
    {
        return UserNameLogin;
    }
    public void SetUserNameOfLoginProgram(string Usr)
    {
        UserNameLogin = Usr;
    }

    }

